package com.crm.common;

import com.crm.dao.SystemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class StartupRunner implements ApplicationRunner {

    @Autowired
    private SystemMapper systemMapper;

    @Override
    public void run(ApplicationArguments args) throws Exception {
//        List<Map> list = systemMapper.getOptions();
//        for (Map map : list){
//            Config.table_key.put((String) map.get("sysname"), String.valueOf(map.get("sysvalue")) );
//        }
//        //设置每个表格number长度
//        Config.tableNumberLength.put("goods",3L);
//        Config.tableNumberLength.put("in_store_idx",4L);
//        Config.tableNumberLength.put("out_store_idx",4L);
    }
}
